<script setup lang="ts">
import {ref} from 'vue';

let isShow=ref(true)
isShow.value=false;

let onshow=()=>{    
    isShow.value=!isShow.value
}
</script>
<template>
    <div>
        <h1 v-if="isShow">你好</h1>
        <h1 v-else>你不好</h1>
        <div>
            <button @click="onshow">显示</button>
        </div>
        <div v-show="isShow">我是show</div>
    </div>
</template>
<style scoped></style>